<%--
  支付业务备付金日结平衡表
  User: 蒯越
  Date: 2016/7/7
  Time: 15:03
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../common/taglibs.jsp" %>
<html>
<head>
    <title>支付业务备付金日结平衡表</title>
    <script src="${ctx}/js/views/common/big.min.js"></script>
    <script src="${ctx}/js/views/report/fundDayBalanceReport.js"></script>
    <link rel="stylesheet" href="${ctx}/css/common.css">

    <link rel="stylesheet" href="${ctx}/css/Report.css" media="print" id="c_or">
    <style type="text/css">
        .printdiv {-webkit-text-size-adjust:none;-webkit-transform: scale(0.75); margin-left: -145px;margin-right: -130px;margin-top: -30px;}
        .printdiv table {font-size:5px;border:1px solid #dedede; border-collapse:collapse;width: inherit}
        .printdiv table  tr th{
            -webkit-text-size-adjust:none;
            border-width: 1px;
            padding: 2px;
            border-style: solid;
            border-color: #000;
            font-size: 9px;
            font-family: 宋体;

        }
        .printdiv table  tr td{
            -webkit-text-size-adjust:none;
            border-width: 1px;
            padding: 2px;
            border-style: solid;
            border-color: #000;
            font-size: 9px;
            text-align: center;
        }
        .input-xtd{
            width: 150px;
        }
        .input-time{
            width: 80px;
        }
        .title{font-size: 14px;font-weight: 500;}
        .input-sss{
            width: 98%;
        }
        .input-std{
            width: 70px;
        }
        .input-xtd{
            width: 150px;
        }


    </style>
</head>
<body ng-app="myApp" style="overflow:scroll;overflow-x:hidden">
<input style="display: none" id="report" value="${ctx}/css/Report.css"/>
<input style="display: none" id="reportIE" value="${ctx}/css/ReportIE.css"/>
<script src="${ctx}/js/views/report/jquery.jqprint-0.3.js"></script>
<core:import url="../common/pageHead.jsp">
    <core:param name="title" value="支付业务备付金日结平衡表"/>
</core:import>
<div ng-controller="queryCtrl" class="container-fluid">
    <form id="queryForm" name="queryForm" action="${ctx}/report/dayBalanceReport/search"
          novalidate w5c-form-validate="vm.validateOptions">
        <table class="table table-bordered table-condensed">
            <tr>
                <td class="text-right">
                    <span class="glyphicon glyphicon-calendar">清算日期</span>
                </td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup
                           ng-model="vm.queryBean.oDate" required/>
                </td>
            </tr>
            <tr align="center">
                <td colspan="6">
                    <button type="button" ng-click="vm.queryDetail()" class="btn btn-default"
                            ng-disabled="queryForm.$invalid">
                        查询
                    </button>
                    <button type="button" ng-click="vm.resetForm()" class="btn btn-default">重置</button>
                    <button type="button" down-file="${ctx}/report/fundDayBalanceReport" params="vm.queryBean"
                            down-file-type="xls" class="btn btn-default" down-cfg="vm.downCfg">
                        下载
                    </button>
                </td>
            </tr>
        </table>
    </form>
    <div>
        <shiro:hasPermission name="dayBalanceReport_create">
            <button ng-click="vm.create()" class="btn btn-default">生成</button>
        </shiro:hasPermission>
            <button ng-click="vm.print()" class="btn btn-default">打印</button>
        <shiro:hasPermission name="dayBalanceReport_fundHandle">
            <button ng-click="vm.fundHandle(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].reportNo != null && vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler == null"
                    class="btn btn-default">经办</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_fundAuditPass">
            <button ng-click="vm.fundAuditPass(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler != null && vm.pagination.list[0].dayBalanceReportDataList[0].fundAuditor == null"
                    class="btn btn-default">审核通过</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_fundAuditNoPass">
            <button ng-click="vm.fundAuditNoPass(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler != null && vm.pagination.list[0].dayBalanceReportDataList[0].fundAuditor == null"
                    class="btn btn-default">审核不通过</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_auditRollBack">
            <button ng-click="vm.auditRollBack(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler != null"
                    class="btn btn-default">审核回退</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_bankBeforeRebuid">
            <button ng-click="vm.bankBeforeRebuid(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].reportNo != null && vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler == null"
                    class="btn btn-default">重跑备付金数据</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_tasterBank">
            <button ng-click="vm.tasterBank(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].fundAuditor != null && vm.pagination.list[0].dayBalanceReportDataList[0].tasterBank == null"
                    class="btn btn-default">审阅</button>
        </shiro:hasPermission>
        <div>
            填表日期：{{vm.pagination.list[0].dayBalanceReportDataList[0].createdTime | date:"yyyy-MM-dd"}}
        </div>

        <table table-detail>
            <thead>
            <tr>
                <th colspan="4">1、支付机构侧日结数据（T日处理数据）</th>
                <th colspan="3">2、备付金银行账户收款（T日处理数据）</th>
                <th colspan="5">3、备付金账户日结数据和支付机构侧对账差异（T日处理数据）C=D-E-F+G-H</th>
                <th colspan="9">4、财务部门备付金对应账户日结数据（T日处理数据）</th>
            </tr>
            <tr>
                <th>机构清算日期</th>
                <th>支付机构名称</th>
                <th>笔数</th>
                <th>金额（应收款项）</th>
                <th>银行账户名称</th>
                <th>T日发生额</th>
                <th>差异</th>
                <th>T日支付，T日未达金额（1）</th>
                <th>T-N日未达,T日资金已达（2）</th>
                <th>T日先达金额(3)</th>
                <th>T-N日资金先达，T日数据已达(4)</th>
                <th>非业务金额（5）</th>
                <th>商户名称</th>
                <th>T日销账成功（1）</th>
                <th>其中：T-N日支付，T日销账成功（2）</th>
                <th>T+N日支付，T日销账A</th>
                <th>T日待销账（3）</th>
                <th>T日支付，T-N日已销账B</th>
                <th>T日前支付未销，在T日完成退款（4）</th>
                <th>合计</th>
                <th>操作</th>
            </tr>
            <tr>
                <th></th>
                <th></th>
                <th></th>
                <th>A</th>
                <th></th>
                <th>B</th>
                <th>C=A-B</th>
                <th>D</th>
                <th>E</th>
                <th>F</th>
                <th>G</th>
                <th>H</th>
                <th></th>
                <th>I</th>
                <th>J</th>
                <th>K</th>
                <th>L</th>
                <th>M</th>
                <th>N</th>
                <th>O=I-J-K+L+M-N=A</th>
                <th></th>
            </tr>
            </thead>
            <tbody ng-repeat="bean in vm.pagination.list">
                <tr ng-repeat="dayBalanceReportData in bean.dayBalanceReportDataList track by $index">
                    <td>{{dayBalanceReportData.settleDate | date:"yyyy-MM-dd"}}</td>
                    <td>{{vm.cached.COMANY_CODE[dayBalanceReportData.payOrgCode]}}</td>
                    <td>{{dayBalanceReportData.bankTransCountD + dayBalanceReportData.bankTransCountC}}</td>
                    <td>{{(dayBalanceReportData.bankTransAmtD - dayBalanceReportData.bankTransAmtC) / 100 | currency:""}}</td>
                    <td rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        {{bean.provisionsAccountName}}
                    </td>
                    <td rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        {{bean.provisionsAccrualAmt / 100 | currency:""}}
                    </td>
                    <td rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        {{bean.differenceAmt / 100 | currency:""}}
                    </td>
                    <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                            ng-show="bean.show == false">{{dayBalanceReportData.noReceiveAmt / 100 | currency:""}}</td>
                    <td ng-show="bean.show == true" class="input-std">
                        <input ng-model="dayBalanceReportData.noReceiveAmt" type="number" step="0.01" class="input-sss"/>
                    </td>
                    <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                            ng-show="bean.show == false">{{dayBalanceReportData.beforeNoReceiveAmt / 100 | currency:""}}</td>
                    <td ng-show="bean.show == true" class="input-std">
                        <input ng-model="dayBalanceReportData.beforeNoReceiveAmt" type="number" step="0.01" class="input-sss" />
                    </td>
                    <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                            ng-show="bean.show == false" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        {{bean.receiveEarlierAmt / 100 | currency:""}}
                    </td>
                    <td ng-show="bean.show == true" class="input-std" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        <input ng-model="bean.receiveEarlierAmt" type="number" step="0.01" class="input-sss" />
                    </td>
                    <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                            ng-show="bean.show == false">{{dayBalanceReportData.beforeReceiveEarlierAmt / 100 | currency:""}}</td>
                    <td ng-show="bean.show == true" class="input-std">
                        <input ng-model="dayBalanceReportData.beforeReceiveEarlierAmt" type="number" step="0.01" class="input-sss" />
                    </td>
                    <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                            ng-show="bean.show == false" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        {{bean.nonBusinessAmt / 100 | currency:""}}
                    </td>
                    <td ng-show="bean.show == true" class="input-std" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        <input ng-model="bean.nonBusinessAmt" type="number" step="0.01" class="input-sss" />
                    </td>
                    <td>{{vm.cached.MERCHANT_CODE[dayBalanceReportData.mchntCode]}}</td>
                <td>{{(dayBalanceReportData.mchntTransAmtC - dayBalanceReportData.mchntTransAmtD) / 100 | currency:""}}</td>
                    <td>{{dayBalanceReportData.dateNotMatchAmt / 100 | currency:""}}</td>
                    <td>{{dayBalanceReportData.mchntLaterAmt / 100 | currency:""}}</td>
                    <td>{{dayBalanceReportData.payMoreAmt / 100 | currency:""}}</td>
                    <td>{{dayBalanceReportData.payBeforeAmt / 100 | currency:""}}</td>
                    <td>{{dayBalanceReportData.correspondOrgAmtD / 100 | currency:""}}</td>
                <td>{{(dayBalanceReportData.mchntTransAmtC - dayBalanceReportData.mchntTransAmtD - dayBalanceReportData.dateNotMatchAmt + dayBalanceReportData.payMoreAmt
                        -dayBalanceReportData.mchntLaterAmt + dayBalanceReportData.payBeforeAmt) / 100 | currency:""}}</td>
                    <td ng-show="bean.show == false" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        <shiro:hasPermission name="dayBalanceReport_bankUpdate">
                            <button ng-click="vm.bankUpdate(bean)"
                                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].reportNo != null && vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler == null"
                                    class="btn btn-default">修改</button>
                        </shiro:hasPermission>
                    </td>
                    <td ng-show="bean.show == true" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                        <shiro:hasPermission name="dayBalanceReport_bankUpdate">
                            <button ng-click="vm.bankUpdate(bean)"
                                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].reportNo != null && vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler == null"
                                    class="btn btn-default">保存</button>
                        </shiro:hasPermission>
                    </td>
                </tr>
            </tbody>
            <tfoot>
            <tr style="text-align: center"
                my-color="vm.sumObject.red" my-color-true="true" my-color-code="f08080" my-color-type="font">
                <td></td>
                <td>合计</td>
                <td>{{vm.sumObject.bankTransCountD + vm.sumObject.bankTransCountC}}</td>
                <td>{{(vm.sumObject.bankTransAmtD - vm.sumObject.bankTransAmtC) / 100 | currency:""}}</td>
                <td>合计</td>
                <td>{{vm.sumObject.provisionsAccrualAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.differenceAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.noReceiveAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.beforeNoReceiveAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.receiveEarlierAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.beforeReceiveEarlierAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.nonBusinessAmt / 100 | currency:""}}</td>
                <td>合计</td>
                <td>{{(vm.sumObject.mchntTransAmtC - vm.sumObject.mchntTransAmtD) / 100 | currency:""}}</td>
                <td>{{vm.sumObject.dateNotMatchAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.mchntLaterAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.payMoreAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.payBeforeAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.correspondOrgAmtD / 100 | currency:""}}</td>
                <td>{{(vm.sumObject.mchntTransAmtC - vm.sumObject.mchntTransAmtD - vm.sumObject.dateNotMatchAmt + vm.sumObject.payMoreAmt
                    -vm.sumObject.mchntLaterAmt + vm.sumObject.payBeforeAmt) / 100 | currency:""}}</td>
            </tr>
            </tfoot>
        </table>
        <div>
            经办：{{vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler}}<br/>复核：{{vm.pagination.list[0].dayBalanceReportDataList[0].fundAuditor}}
            <br/>主管：{{vm.pagination.list[0].dayBalanceReportDataList[0].tasterBank}}
        </div>


                    </tr>
                    <tr>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th>A</th>
                        <th></th>
                        <th>B</th>
                        <th style="width:60px">C=A-B</th>
                        <th>D</th>
                        <th>E</th>
                        <th>F</th>
                        <th>G</th>
                        <th>H</th>
                        <th></th>
                        <th>I</th>
                        <th>J</th>
                        <th>K</th>
                        <th>L</th>
                        <th>M</th>
                        <th>N</th>
                        <th>O=I-J-K+L+M-N=A</th>

                    </tr>
                    </thead>
                    <tbody ng-repeat="bean in vm.pagination.list">
                    <tr ng-repeat="dayBalanceReportData in bean.dayBalanceReportDataList track by $index">
                        <td>{{dayBalanceReportData.settleDate | date:"yyyy-MM-dd"}}</td>
                        <td class="input-xtd">{{vm.cached.COMANY_CODE[dayBalanceReportData.payOrgCode]}}</td>
                        <td>{{dayBalanceReportData.bankTransCountD + dayBalanceReportData.bankTransCountC}}</td>
                        <td>{{(dayBalanceReportData.bankTransAmtD - dayBalanceReportData.bankTransAmtC) / 100 | currency:""}}</td>
                        <td rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0" class="input-xtd">
                            {{bean.provisionsAccountName}}
                        </td>
                        <td rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                            {{bean.provisionsAccrualAmt / 100 | currency:""}}
                        </td>
                        <td  rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                            {{bean.differenceAmt / 100 | currency:""}}
                        </td>
                        <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                             ng-show="bean.show == false">{{dayBalanceReportData.noReceiveAmt / 100 | currency:""}}</td>

                        <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                             ng-show="bean.show == false">{{dayBalanceReportData.beforeNoReceiveAmt / 100 | currency:""}}</td>

                        <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                             ng-show="bean.show == false" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                            {{bean.receiveEarlierAmt / 100 | currency:""}}
                        </td>

                        <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                             ng-show="bean.show == false">{{dayBalanceReportData.beforeReceiveEarlierAmt / 100 | currency:""}}</td>

                        <td  my-color="bean.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                             ng-show="bean.show == false" rowspan="{{bean.dayBalanceReportDataList.length}}"  ng-if="$index == 0">
                            {{bean.nonBusinessAmt / 100 | currency:""}}
                        </td>

                        <td class="input-xtd">{{vm.cached.MERCHANT_CODE[dayBalanceReportData.mchntCode]}}</td>
                        <td>{{(dayBalanceReportData.mchntTransAmtC - dayBalanceReportData.mchntTransAmtD) / 100 | currency:""}}</td>
                        <td>{{dayBalanceReportData.dateNotMatchAmt / 100 | currency:""}}</td>
                        <td>{{dayBalanceReportData.mchntLaterAmt / 100 | currency:""}}</td>
                        <td>{{dayBalanceReportData.payMoreAmt / 100 | currency:""}}</td>
                        <td>{{dayBalanceReportData.payBeforeAmt / 100 | currency:""}}</td>
                        <td>{{dayBalanceReportData.correspondOrgAmtD / 100 | currency:""}}</td>
                        <td>{{(dayBalanceReportData.mchntTransAmtC - dayBalanceReportData.mchntTransAmtD - dayBalanceReportData.dateNotMatchAmt + dayBalanceReportData.payMoreAmt
                            -dayBalanceReportData.mchntLaterAmt + dayBalanceReportData.payBeforeAmt) / 100 | currency:""}}</td>
                    </tr>

                    <%--///////--%>


                    <%--///////--%>
                    </tbody>
                    <tr style="text-align: center"
                        my-color="vm.sumObject.red" my-color-true="true" my-color-code="f08080" my-color-type="font">
                        <td></td>
                        <td>合计</td>
                        <td>{{vm.sumObject.bankTransCountD + vm.sumObject.bankTransCountC}}</td>
                        <td>{{(vm.sumObject.bankTransAmtD - vm.sumObject.bankTransAmtC) / 100 | currency:""}}</td>
                        <td>合计</td>
                        <td>{{vm.sumObject.provisionsAccrualAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.differenceAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.noReceiveAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.beforeNoReceiveAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.receiveEarlierAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.beforeReceiveEarlierAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.nonBusinessAmt / 100 | currency:""}}</td>
                        <td>合计</td>
                        <td>{{(vm.sumObject.mchntTransAmtC - vm.sumObject.mchntTransAmtD) / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.dateNotMatchAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.mchntLaterAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.payMoreAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.payBeforeAmt / 100 | currency:""}}</td>
                        <td>{{vm.sumObject.correspondOrgAmtD / 100 | currency:""}}</td>
                        <td>{{(vm.sumObject.mchntTransAmtC - vm.sumObject.mchntTransAmtD - vm.sumObject.dateNotMatchAmt + vm.sumObject.payMoreAmt
                            -vm.sumObject.mchntLaterAmt + vm.sumObject.payBeforeAmt) / 100 | currency:""}}</td>
                    </tr>
                </table>
                <div>
                    经办：{{vm.pagination.list[0].dayBalanceReportDataList[0].fundHandler}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    复核：{{vm.pagination.list[0].dayBalanceReportDataList[0].fundAuditor}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    主管：{{vm.pagination.list[0].dayBalanceReportDataList[0].tasterBank}}
    </div>
    <core:import url="../common/pageFoot.jsp"/>
</div>
<core:import url="../common/nav.jsp"/>
</body>
</html>
